<include file="public/header" title="库存管理" body="g4"/>
<style>
    .bankhearder {
        height: 7.73333rem;
    }
     .head_acc ul .red a{
    	color:white!important;
    }
    .allaccounted{
    	/*background: white;*/
    }
    .voucher-box{
		display: flex;
		font-size: .68267rem;
		line-height: 1rem;
	}
	.flex-1{
		flex: 1;
	}
	.flex-2{
		flex: 2;
	}
	.te-ri{
		text-align: right;
	}
	.fll_acc{
		padding: .64rem;
		margin-bottom: .5rem;
		border-bottom: 1px solid #cccccc;
		background: white;
		position: relative;
	}
	.icon-right{
		position: absolute;
		right: 1rem;
    	top: .8rem;
	}
	
	.icon-right1{
		position: absolute;
		right: 1rem;
    	top: 2rem;
	}
	.state-title{
		position: absolute;
		right: 1rem;
    	top: .6rem;
    	font-size: .6rem;
    	color: #E63744;
	}
</style>
    <div class="myhearder bankhearder">
        <div class="hh">
            <h1>我的库存</h1>
            <!-- <foreach name="user_kucun" item="value" key="key">
                <a href="{:U('Mobile/goods/goodsInfo',array('id'=>$key))}" style="color: white;"><h2 style="padding-left:100px;">{$goods_list[$key]['goods_name']}<span style="padding-left:100px;">{$value}盒</span></h2></a>
            </foreach> -->
            <empty name="user_kucun">
                <h2>您还没有任何商品库存</h2>
            </empty>
        </div>
        <div class="scgz">
            <ul>
                <li>
                    <a href="{:U('Mobile/index/index')}">
                        <img src="__STATIC__/images/cz.png"/>
                        <p>我要购买</p>
                    </a>
                </li>
                <li>
                    <a href="{:U('Mobile/User/tihuo')}">
                        <img src="__STATIC__/images/tx.png"/>
                        <p>申请提货</p>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <div class="allaccounted">
        <div class="">
            <div class="head_acc ma-to-20" style="margin: .64rem;">
                <ul>
                    <li <if condition="$type eq 'all'">class="red"</if>">
                        <a href="{:U('User/kucun',array('type'=>'all'))}"  data-list="1">库存列表</a>
                    </li> 
                    <li <if condition="$type eq '1'">class="red"</if>>
                        <a href="{:U('User/kucun',array('type'=>'1'))}"   data-list="2">入库订单</a>
                    </li>
                    <li  <if condition="$type eq '2'">class="red"</if>>
                        <a href="{:U('User/kucun',array('type'=>'2'))}"  data-list="3">提货订单</a>
                    </li>
                </ul>
            </div>

             <div class="allpion">
<!--                     <div class="fll_acc">
                        <ul><li>订单编号</li><li>库存增减</li><li>时间</li></ul>
                     </div> -->
                     <if condition="$type eq 'all' ">
                     <foreach name="user_kucun" item="value" key="key">
                        <div class="fll_acc">
                        	<a class="warehouse-box" href="{:U('Mobile/goods/goodsInfo',array('id'=>$key))}">
	                        	 <div class="voucher-box">
	                        	 	<div class="flex-2">{$goods_list[$key]['goods_name']}</div>
	                        	 	<div class="flex-1">x{$value}</div>
	                        	 </div>
                        	</a>
                        	<i class="Mright icon-right"></i>
                        	
                            <!--<ul>
                                <li style="width:50%"><a href="{:U('Mobile/goods/goodsInfo',array('id'=>$key))}">{$goods_list[$key]['goods_name']}</a></li>
                                <li style="width:50%">x{$value}</li>
                            </ul>-->
                        </div>
                    </foreach>
                    <empty name="user_kucun">
                             <div class="none" >
                                <img src="__STATIC__/images/none2.png">
                                <br><br>
                                <i class="account-acco1"></i>您还没有任何商品库存
                                <div class="paiton">                                    
                                </div>
                            </div>
                    </empty>
                    <else/>     
                    <foreach name="users_kucun_log" item="v">
                        <div class="fll_acc">
                            <if condition="$v.status eq '1' ">
                            	<a href="{:U('User/order_detail',array('id'=>$v[order_id]))}"><else/><a href="{:U('User/tihuo_detail',array('id'=>$v[tihuo_id]))}"></if>
	                              
	                              <div class="voucher-box">
	                              	 <div class="flex-1"><if condition="$v.status eq '1' ">订单编号：<else/>提货编号：</if></div>
	                              	 <div class="flex-2"><if condition="$v.status eq '1' ">{$v[order_sn]}<else/>{$v[tihuo_sn]}</if></div>
	                              </div>
	                              
	                              <div class="voucher-box">
	                              	<div class="flex-1"><if condition="$v.status eq '1' ">入库时间：<else/>提货时间：</if></div>
	                              	<div class="flex-2">{:date('Y-m-d H:i:s',$v[create_time])}</div>
	                              </div>
	                              
	                              <?php $kucun=unserialize($v['kucun']);foreach($kucun as $key => $value){ ?>
	                              	<div class="voucher-box">
	                              		<div class="flex-2">{$goods_list[$key]['goods_name']}</div>
	                              		<div class="flex-1">x{$value}</div>
	                              	</div>
	                              <?php } ?>
	                              	
	                              	
	                              	<span class="state-title"><if condition="$v.status eq '1' ">{$order_info[$v['order_id']]}<else/>{$tihuo_info[$v['tihuo_id']]}</if></span>
	                           		<i class="Mright icon-right1"></i>

                            	</a>
                            
                          
                          
                        </div>
                    </foreach>
                    <empty name="users_kucun_log">
                             <div class="none" >
                                <img src="__STATIC__/images/none2.png">
                                <br><br>
                                <i class="account-acco1"></i>您还没有此记录
                                <div class="paiton">                                    
                                </div>
                            </div>
                    </empty>
                    </if>          
            </div>

            <div id="getmore"  style="font-size:.5rem;text-align: center;color:#888;padding:.25rem .24rem .4rem; clear:both;display: none">
                <a >已显示完所有记录</a>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="__STATIC__/js/sourch_submit.js"></script>
    <script type="text/javascript">
    //    var record=$('.record').val();   //获取记录类型
        //加载更多记录
        var page = 1;
        function ajax_sourch_submit()
        {
            page ++;
            $.ajax({
                type : "GET",
                url:"/index.php?m=Mobile&c=User&a=kucun&is_ajax=1&type={$type}&p="+page,//+tab,
                success: function(data)
                {
                    if($.trim(data) == '') {
                        $('#getmore').show();
                        return false;
                    }else{
                        $(".allpion").append(data);}
                }
            });
        }
        function ajax_account_detail(obj){
                window.location.href=$(obj).data('url');
        }
    </script>
    <!--底部导航-start-->
    <include file="public/footer_nav" />
    <!--底部导航-end-->
</body>
</html>
